package com.yc.spring.demo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/7/31
 * Email haijunzhou@hnit.edu.cn
 */
@Data
@Component("PersonAuto")
public class Person {

    String name;
    int age;
    char gender;
    List<String> likes;
    Person father;
    Person mather;

    public Person() {
        System.out.println("^^^^^0^^^" + this);
        System.out.println("---------0-------------");
    }

    public Person(String name, int age) {
        System.out.println("^^^^1^^^^" + this);
        System.out.println("---------1-------------");
        this.name = name;
        this.age = age;
    }

    public Person(int age, String name) {
        System.out.println("^^^^^2^^^" + this);
        System.out.println("---------2-------------");
        this.name = name;
        this.age = age;
    }

    public void hello(){
        System.out.println("hello " + name);
    }

    public Person create(){
        return new Person("王五",20);
    }

    public static Person staticCreate(){
        return new Person("赵六",20);
    }

    void init(){
        System.out.println(this);
        System.out.println("对象创建完成!");
    }

    void destroy(){
        System.out.println(this);
        System.out.println("对象销毁完成!");
    }


}
